/*
 * RandomNumber.cpp
 *
 *  Created on: Jan 15, 2012
 *      Author: luiz
 */

#include "RandomNumber.h"

RandomNumber *RandomNumber::instance =NULL;
RandomNumber::~RandomNumber()
{
//  / delete instance;
}

int RandomNumber::getRandomInteger(int between)
{
    return rand()%between;
}



RandomNumber::RandomNumber(long  seed)
{
    srand(seed);
}

double RandomNumber::getRandonDouble()
{
    return (double) ((double)rand() / RAND_MAX);
}

void RandomNumber::change_seed(long  new_seed)
{
    if(instance!=NULL)
        delete instance;
    instance = new RandomNumber(new_seed);
}

void RandomNumber::delete_instance()
{
    delete instance;
}







